{% include "../public/min-header.html" %}
<div class="wrapper">
    <link rel="stylesheet" href="/public/tool/layui/css/layui.css">
    <script type="text/javascript" src="/public/tool/layui/layui.js"></script>
    {% include "../public/breadcrumb.html" %}
    <section class="content ">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default"
                    data-original-title="返回管理员列表"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i>二维码解析</h3>
                </div>
                <div class="panel-body ">
                    <!--表单数据-->
                    <form id="submitForm">
                        <!--通用信息-->
                        <div class="tab-content col-md-10">
                            <div class="tab-pane active" id="tab_tongyong">
                                <table class="table table-bordered">
                                    <tbody>
                                        <tr>
                                            <td>二维码：</td>
                                            <td>
                                                <input id="qrcode_file_upload" type="file" multiple="true" size="18"
                                                    class="input-sm">
                                                <input type="text" class="form-control url" name="url"
                                                    value="" readonly>
                                            </td>
                                        </tr>
                                    </tbody>
                                    <tfoot>
                                        <tr>
                                        </tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </form>
                    <!--表单数据-->
                </div>
            </div>
        </div>
    </section>
</div>
<script type="text/javascript">
    layui.use('layer', function () {
        var layer = layui.layer;
    });
    $(function () {
        $('#qrcode_file_upload').uploadifive({
            uploadScript: "{{helper.pathFor('adtlqrt')}}",
            buttonText: '上传图片',
            fileTypeDesc: 'Image Files',
            auto: true, // 选择文件后自动上传
            fileObjName: 'file',
            formData: {},
            // 允许上传的文件后缀
            fileTypeExts: '*.gif; *.jpg; *.png',
            onUploadComplete(file, data) {
                const response = true;
                if (response) {
                    const obj = JSON.parse(data); // 由JSON字符串转换为JSON对象
                    console.log(obj);
                    if (obj.status == 1) {
                        const fileurl = obj.data.url;
                        $('.url').val(fileurl);
                    } else {
                        layer.msg(obj.message ? obj.message : '服务器错误');
                    }
                } else {
                    layer.msg('上传失败');
                }
            },
        });
    });

</script>
{% include "../public/main-footer.html" %}